home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 October / Gamestar_77_2005-10_dvd.iso / Dema / betonsoldier_spdemo.exe / {app} / Shaders / mesh_shadow.fx < prev    next >
Encoding:
Text File  |  2005-05-05  |  3.2 KB  |  85 lines

  1. //------------------------------------------------------------------------------------------------------
  2. //------------------------------------------------------------------------------------------------------
  3. //------------------------------------------------------------------------------------------------------
  4.  
  5. //------------------------------------------------------------------------------------------------------
  6. //- Static parameters
  7. //------------------------------------------------------------------------------------------------------
  8.  
  9. //------------------------------------------------------------------------------------------------------
  10. //------------------------------------------------------------------------------------------------------
  11. //------------------------------------------------------------------------------------------------------
  12.  
  13. struct    CVertexShaderShadowInput
  14. {
  15.     float4    Position    :    POSITION;
  16. };
  17.  
  18. //------------------------------------------------------------------------------------------------------
  19.  
  20. struct    CVertexShaderShadowOutput
  21. {
  22.     float4    Position            :    POSITION;
  23. };
  24.  
  25. //------------------------------------------------------------------------------------------------------
  26. //------------------------------------------------------------------------------------------------------
  27. //------------------------------------------------------------------------------------------------------
  28.  
  29. CVertexShaderShadowOutput    ShadowPass    (const CVertexShaderShadowInput input);
  30.  
  31. //------------------------------------------------------------------------------------------------------
  32. //------------------------------------------------------------------------------------------------------
  33. //------------------------------------------------------------------------------------------------------
  34.  
  35. CVertexShaderShadowOutput    ShadowPass    (const CVertexShaderShadowInput input)
  36. {
  37.     CVertexShaderShadowOutput output;
  38.     
  39.     // output position into world+view+projection space
  40.     output.Position = mul (input.Position,WorldCameraProjection);
  41.         
  42.     return output;
  43. }
  44.  
  45. //------------------------------------------------------------------------------------------------------
  46. //------------------------------------------------------------------------------------------------------
  47. //------------------------------------------------------------------------------------------------------
  48.  
  49. technique    tech_shadow
  50. <
  51.     int Priority = 1;
  52.     int TechniqueIndex = 0;
  53.     int DeviceType = HWSHADER_ONLY;
  54.     int LightingType = INTEGRATED_LIGHTING;
  55.     string RenderingType = "Shadow";
  56. >
  57. {
  58.     pass pass1
  59.     {
  60.         CullMode            = CW;
  61.         ZEnable                = true;
  62.         ZFunc                = LESSEQUAL;
  63.         
  64.         ZWriteEnable        = true;
  65.         AlphaBlendEnable    = false;
  66.         AlphaTestEnable        = false;
  67.         FogEnable            = false;
  68.         
  69.         VertexShader = compile vs_1_1 ShadowPass();
  70.         
  71.         PixelShaderConstant[0]        = {0.0f,0.0f,0.0f,1.0f};
  72.         
  73.         PixelShader = 
  74.         asm
  75.         {
  76.             ps_1_1
  77.             
  78.             mov r0,c0
  79.         };
  80.     }
  81. }
  82.  
  83. //------------------------------------------------------------------------------------------------------
  84. //------------------------------------------------------------------------------------------------------
  85. //------------------------------------------------------------------------------------------------------